package com.yjc.rabbitmq.springboot_rabbitmq.consumer;

import com.yjc.rabbitmq.springboot_rabbitmq.config.ConfirmConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author shkstart
 * @create 2022-08-05 12:45
 */
@Slf4j
@Component
public class WarningConsumer {

    @RabbitListener(queues = ConfirmConfig.WARNING_QUEUE)
    public void receiveWarningMsg(Message message) {
        log.error("警告：发现不可路由消息{}", new String(message.getBody()));

    }

}
